<template>
	<view class="goods-item padding-bottom">
		<image :src="gdata.img" mode=""></image>
		<view class="flex justify-between align-center">
			<view class="">
				<view class="margin-tb-xs">
					{{gdata.name}}
				</view>
				<view class="text-xs text-cut">
					{{gdata.french}}
				</view>
			</view>
			<view @click="handleCart" class="cu-avatar round bg-yellow text-white margin-right-xs flex-0">
				<text class="iconfont icon-gouwuche"></text>
			</view>
		</view>
		<view class="margin-tb-xs text-price">
			{{gdata.price}}
		</view>
	</view>
</template>

<script>
	export default {
		name:"goods-item",
		props:{
			gdata:{
				type:Object,
				required:true
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			handleCart() {
				this.$store.commit('cart/popDataMut',this.gdata)
				this.$store.commit('cart/popShowMut',true)
			}
		},
	}
</script>

<style lang="scss">
.goods-item{
	width: 351upx;
	image{
		width: 100%;
		height: 351upx;
	}
}
.bg-yellow{
	flex-shrink: 0;
}
.text-cut{
	max-width: 250upx;
}
</style>